D. while-do
Q50: In a particular algorithm in a Solidity file, we need to continue a
repetitive calculation till a particular value is reached. After the
value is reached, the calculation should continue for one last
time. Which control statement would you choose?
A. If-else
B. Switch
C. do-while
D. while-do
Q51: As Solidity does not support the Switch statement, what else
can you do to replace the same behavior?
A. if-else
B. if-else if-else
C. for loop
D. do-while loop
Q52: What are the advantages of the ternary operator over the if-
else statement?
A. Ternary Operator is more readable than the If conditions
B. Ternary Operator is suitable for executing a function or several
statements
C. Ternary Operator runs faster than the If-Else statement
D. All of the above
Q53: Break statements are useful for which of the following?
A. Control breaking a loop and going ahead with the execution of
the next line
B. Control breaking an If-Else statement and going ahead with the
execution of the next line
C. Control breaking a ternary operator and going ahead with the
execution of the next line
D. None of these